//
//  JLSDK.h
//  JLSDK
//
//  Created by LZ on 2018/7/19.
//  Copyright © 2018年 JLPAY. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "JLSDKInitModel.h"
#import "JLDeviceKeyModel.h"
#import "JLTradeData.h"
#import "JLPayTradeInfo.h"
#import "JLFailureModel.h"

@class UIImage;
@class CLLocation;

typedef void (^CallBack)(NSString *macValue);

@interface JLSDK : NSObject

/**
SDK注册，除加密请求操作外面的接口需先注册
SDK注册成功后，返回签到Key值
 
 @param initModel <#initModel description#>
 @param success <#success description#>
 @param failure <#failure description#>
 */
+ (void)registerWithModel:(JLSDKInitModel *)initModel
                   succes:(void(^)(JLDeviceKeyModel *data))success
                  failure:(void(^)(NSError *error))failure;

/**
 加密请求操作

 @param type 类型代码 (020等，查看文档)
 @param jsonString 参数的json string
 */
+ (void)encryptRequestWithType:(NSString *)type
                          json:(NSString *)jsonString
                       success:(void(^)(NSData *data))success
                       failure:(void(^)(NSError *error))failure;

/**
 交易

 @param tradeData <#data description#>
 @param macBlock <#macBlock description#>
 @param success <#success description#>
 @param failure <#failure description#>
 */
+ (void)sdkTransWithParam:(JLTradeData *)tradeData
                 macBlock:(void(^)(NSString *xorStr,CallBack block))macBlock
                  success:(void(^)(JLPayTradeInfo *data))success
                  failure:(void(^)(JLFailureModel *failureModel))failure;

/**
 上传签名照片

 @param orderId <#orderId description#>
 @param img <#img description#>
 @param success <#success description#>
 @param failure <#failure description#>
 */
+ (void)sdkElesignWithOrderId:(NSString *)orderId
                      signImg:(UIImage *)img
                      success:(void(^)(NSData *data))success
                      failure:(void(^)(JLFailureModel *failureModel))failure;


/**
 获取定位信息
 
 @param success 回调定位成功的location
 @param failure 定位失败回调
 */
+ (void)sdkRequestLocationWithSuccess:(void(^)(CLLocation *loction))success
                              failure:(void(^)(NSError *error))failure;

/**
 SDK
 输出开关，默认关闭

 @param debug <#debug description#>
 */
+ (void)setDebugMode:(BOOL)debug;


/**
 SDK版本

 @return <#return value description#>
 */
+ (NSString *)sdkVersion;

@end
